'use strict';
angular.module('app').controller('companyCtrl', ['$http', '$state','$scope', function ($http, $state, $scope) {
    $http({
        method: 'GET',
        url: '/data/company.json?id='+$state.params.id
    }).then(function successCallback(resp) {
        $scope.company = resp.data;
        $scope.$broadcast('abc', {id:1});//广播方，即发送方，需要在页面加载后进行广播，防止接收方获取不到
    }, function errCallback() {
    });
    // $scope.$on('cba', function (event, data) {
    //     console.log(data);//接收方
    // });
}]);